package com.dzh.controller;

import com.dzh.mapper.TourMapper;
import com.dzh.pojo.Tour;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {
    @Autowired
   private   TourMapper tourMapper;

    @RequestMapping("")
    public String index(Model model){
      List<Tour> tourList =   tourMapper.queryAllHotTour();
      model.addAttribute("tourlist",tourList);
        return "index";
    }

    @RequestMapping("/totourlist")
    public String tourlist(){
        return "tour_list";
    }
}
